The basic idea behind the view state feature is that when a form is submitted in ASP .NET, the form reappears in the browser window together with all form values. When we need a page variable to maintain its value across page post backs, we can use ViewState to store that value. By default ViewState property is set to True.
Disable ViewState for Specific control
<asp:TextBox ID="txtNum1" runat="server" EnableViewState="false"></asp:TextBox>
Disable ViewState for whole page Controls
<%@ Page language="C#" EnableViewState="false" %>
Leave Comment